home *** CD-ROM | disk | FTP | other *** search
- // Borland C++ Builder
- // Copyright (c) 1995, 1998 by Borland International
- // All rights reserved
-
- // (DO NOT EDIT: machine generated header) 'DBTables.pas' rev: 3.00
-
- #ifndef DBTablesHPP
- #define DBTablesHPP
- #include <StdVCL.hpp>
- #include <SMIntf.hpp>
- #include <Bde.hpp>
- #include <DBCommon.hpp>
- #include <Db.hpp>
- #include <Controls.hpp>
- #include <Classes.hpp>
- #include <Graphics.hpp>
- #include <SysUtils.hpp>
- #include <Windows.hpp>
- #include <SysInit.hpp>
- #include <System.hpp>
-
- //-- user supplied -----------------------------------------------------------
-
- namespace Dbtables
- {
- //-- type declarations -------------------------------------------------------
- typedef Bde::FLDDesc TFieldDescList[1024];
-
- typedef TFieldDescList *PFieldDescList;
-
- typedef Bde::IDXDesc TIndexDescList[64];
-
- typedef TIndexDescList *PIndexDescList;
-
- typedef Bde::SPParamDesc TSPParamDescList[1024];
-
- typedef TSPParamDescList *PSPParamDescList;
-
- class DELPHICLASS EDBEngineError;
- class DELPHICLASS TDBError;
- class PASCALIMPLEMENTATION EDBEngineError : public Db::EDatabaseError
- {
- typedef Db::EDatabaseError inherited;
-
- private:
- Classes::TList* FErrors;
- TDBError* __fastcall GetError(int Index);
- int __fastcall GetErrorCount(void);
-
- public:
- __fastcall EDBEngineError(Word ErrorCode);
- __fastcall virtual ~EDBEngineError(void);
- __property int ErrorCount = {read=GetErrorCount, nodefault};
- __property TDBError* Errors[int Index] = {read=GetError};
- public:
- /* Exception.CreateFmt */ __fastcall EDBEngineError(const System::AnsiString Msg, const System::TVarRec
- * Args, const int Args_Size) : Db::EDatabaseError(Msg, Args, Args_Size) { }
- /* Exception.CreateRes */ __fastcall EDBEngineError(int Ident, Extended Dummy) : Db::EDatabaseError(
- Ident, Dummy) { }
- /* Exception.CreateResFmt */ __fastcall EDBEngineError(int Ident, const System::TVarRec * Args, const
- int Args_Size) : Db::EDatabaseError(Ident, Args, Args_Size) { }
- /* Exception.CreateHelp */ __fastcall EDBEngineError(const System::AnsiString Msg, int AHelpContext
- ) : Db::EDatabaseError(Msg, AHelpContext) { }
- /* Exception.CreateFmtHelp */ __fastcall EDBEngineError(const System::AnsiString Msg, const System::TVarRec
- * Args, const int Args_Size, int AHelpContext) : Db::EDatabaseError(Msg, Args, Args_Size, AHelpContext
- ) { }
- /* Exception.CreateResHelp */ __fastcall EDBEngineError(int Ident, int AHelpContext) : Db::EDatabaseError(
- Ident, AHelpContext) { }
- /* Exception.CreateResFmtHelp */ __fastcall EDBEngineError(int Ident, const System::TVarRec * Args,
- const int Args_Size, int AHelpContext) : Db::EDatabaseError(Ident, Args, Args_Size, AHelpContext) { }
-
-
- };
-
- class DELPHICLASS ENoResultSet;
- class PASCALIMPLEMENTATION ENoResultSet : public Db::EDatabaseError
- {
- typedef Db::EDatabaseError inherited;
-
- public:
- /* Exception.Create */ __fastcall ENoResultSet(const System::AnsiString Msg) : Db::EDatabaseError(Msg
- ) { }
- /* Exception.CreateFmt */ __fastcall ENoResultSet(const System::AnsiString Msg, const System::TVarRec
- * Args, const int Args_Size) : Db::EDatabaseError(Msg, Args, Args_Size) { }
- /* Exception.CreateRes */ __fastcall ENoResultSet(int Ident, Extended Dummy) : Db::EDatabaseError(Ident
- , Dummy) { }
- /* Exception.CreateResFmt */ __fastcall ENoResultSet(int Ident, const System::TVarRec * Args, const
- int Args_Size) : Db::EDatabaseError(Ident, Args, Args_Size) { }
- /* Exception.CreateHelp */ __fastcall ENoResultSet(const System::AnsiString Msg, int AHelpContext) :
- Db::EDatabaseError(Msg, AHelpContext) { }
- /* Exception.CreateFmtHelp */ __fastcall ENoResultSet(const System::AnsiString Msg, const System::TVarRec
- * Args, const int Args_Size, int AHelpContext) : Db::EDatabaseError(Msg, Args, Args_Size, AHelpContext
- ) { }
- /* Exception.CreateResHelp */ __fastcall ENoResultSet(int Ident, int AHelpContext) : Db::EDatabaseError(
- Ident, AHelpContext) { }
- /* Exception.CreateResFmtHelp */ __fastcall ENoResultSet(int Ident, const System::TVarRec * Args, const
- int Args_Size, int AHelpContext) : Db::EDatabaseError(Ident, Args, Args_Size, AHelpContext) { }
-
- public:
- /* TObject.Destroy */ __fastcall virtual ~ENoResultSet(void) { }
-
- };
-
- class PASCALIMPLEMENTATION TDBError : public System::TObject
- {
- typedef System::TObject inherited;
-
- private:
- Word FErrorCode;
- int FNativeError;
- System::AnsiString FMessage;
- Byte __fastcall GetCategory(void);
- Byte __fastcall GetSubCode(void);
-
- public:
- __fastcall TDBError(EDBEngineError* Owner, Word ErrorCode, int NativeError, char * Message);
- __property Byte Category = {read=GetCategory, nodefault};
- __property Word ErrorCode = {read=FErrorCode, nodefault};
- __property Byte SubCode = {read=GetSubCode, nodefault};
- __property System::AnsiString Message = {read=FMessage};
- __property int NativeError = {read=FNativeError, nodefault};
- public:
- /* TObject.Destroy */ __fastcall virtual ~TDBError(void) { }
-
- };
-
- typedef void *TLocale;
-
- typedef Bde::CBRType __fastcall (__closure *TBDECallbackEvent)(void * CBInfo);
-
- class DELPHICLASS TBDECallback;
- class PASCALIMPLEMENTATION TBDECallback : public System::TObject
- {
- typedef System::TObject inherited;
-
- private:
- Bde::_hDBIObj *FHandle;
- System::TObject* FOwner;
- CBType FCBType;
- int FOldCBData;
- void *FOldCBBuf;
- Word FOldCBBufLen;
- Bde::pfDBICallBack FOldCBFunc;
- bool FInstalled;
- TBDECallbackEvent FCallbackEvent;
-
- protected:
- Bde::CBRType __fastcall Invoke(Bde::CBType CallType, void * CBInfo);
-
- public:
- __fastcall TBDECallback(System::TObject* AOwner, Bde::hDBICur Handle, Bde::CBType CBType, void * CBBuf
- , int CBBufSize, TBDECallbackEvent CallbackEvent, bool Chain);
- __fastcall virtual ~TBDECallback(void);
- };
-
- class DELPHICLASS TSessionList;
- class DELPHICLASS TSession;
- class PASCALIMPLEMENTATION TSessionList : public System::TObject
- {
- typedef System::TObject inherited;
-
- private:
- Classes::TList* FSessions;
- Classes::TBits* FSessionNumbers;
- void __fastcall AddSession(TSession* ASession);
- void __fastcall CloseAll(void);
- int __fastcall GetCount(void);
- TSession* __fastcall GetSession(int Index);
- TSession* __fastcall GetCurrentSession(void);
- TSession* __fastcall GetSessionByName(const System::AnsiString SessionName);
- void __fastcall SetCurrentSession(TSession* Value);
-
- public:
- __fastcall TSessionList(void);
- __fastcall virtual ~TSessionList(void);
- __property TSession* CurrentSession = {read=GetCurrentSession, write=SetCurrentSession};
- TSession* __fastcall FindSession(const System::AnsiString SessionName);
- void __fastcall GetSessionNames(Classes::TStrings* List);
- TSession* __fastcall OpenSession(const System::AnsiString SessionName);
- __property int Count = {read=GetCount, nodefault};
- __property TSession* Sessions[int Index] = {read=GetSession/*, default*/};
- __property TSession* List[System::AnsiString SessionName] = {read=GetSessionByName};
- };
-
- enum TConfigModes { cfmVirtual, cfmPersistent, cfmSession };
-
- typedef Set<TConfigModes, cfmVirtual, cfmSession> TConfigMode;
-
- typedef void __fastcall (__closure *TPasswordEvent)(System::TObject* Sender, bool &Continue);
-
- enum TDatabaseEvent { dbOpen, dbClose, dbAdd, dbRemove, dbAddAlias, dbDeleteAlias, dbAddDriver, dbDeleteDriver
- };
-
- typedef void __fastcall (__closure *TDatabaseNotifyEvent)(TDatabaseEvent DBEvent, const void *Param)
- ;
-
- typedef void __fastcall (*TBDEInitProc)(TSession* Session);
-
- enum TTraceFlag { tfQPrepare, tfQExecute, tfError, tfStmt, tfConnect, tfTransact, tfBlob, tfMisc, tfVendor,
- tfDataIn, tfDataOut };
-
- typedef Set<TTraceFlag, tfQPrepare, tfDataOut> TTraceFlags;
-
- class DELPHICLASS TDatabase;
- class PASCALIMPLEMENTATION TSession : public Classes::TComponent
- {
- typedef Classes::TComponent inherited;
-
- private:
- Bde::_hDBIObj *FHandle;
- Classes::TList* FDatabases;
- Classes::TList* FCallbacks;
- void *FLocale;
- Smintf::_di_ISMClient FSMClient;
- Bde::TRACEDesc *FSMBuffer;
- TTraceFlags FTraceFlags;
- bool FSMLoadFailed;
- bool FStreamedActive;
- bool FKeepConnections;
- bool FDefault;
- bool FSQLHourGlass;
- bool FAutoSessionName;
- bool FUpdatingAutoSessionName;
- bool FDLLDetach;
- bool FBDEOwnsLoginCbDb;
- System::AnsiString FSessionName;
- int FSessionNumber;
- System::AnsiString FNetFileDir;
- System::AnsiString FPrivateDir;
- CBSCType FCBSCType;
- int FLockCount;
- int FReserved;
- Bde::TCBDBLogin FCBDBLogin;
- TPasswordEvent FOnPassword;
- Classes::TNotifyEvent FOnStartup;
- TDatabaseNotifyEvent FOnDBNotify;
- void __fastcall AddDatabase(TDatabase* Value);
- void __fastcall CallBDEInitProcs(void);
- void __fastcall CheckInactive(void);
- void __fastcall CheckConfigMode(TConfigMode CfgMode);
- void __fastcall CloseDatabaseHandle(TDatabase* Database);
- Bde::CBRType __fastcall DBLoginCallback(void * CBInfo);
- void __fastcall DBNotification(TDatabaseEvent DBEvent, const void *Param);
- void __fastcall DeleteConfigPath(const System::AnsiString Path, const System::AnsiString Node);
- TDatabase* __fastcall DoFindDatabase(const System::AnsiString DatabaseName, Classes::TComponent* AOwner
- );
- TDatabase* __fastcall DoOpenDatabase(const System::AnsiString DatabaseName, Classes::TComponent* AOwner
- );
- Bde::hDBIDb __fastcall FindDatabaseHandle(const System::AnsiString DatabaseName);
- bool __fastcall GetActive(void);
- TConfigMode __fastcall GetConfigMode(void);
- TDatabase* __fastcall GetDatabase(int Index);
- int __fastcall GetDatabaseCount(void);
- Bde::hDBISes __fastcall GetHandle(void);
- System::AnsiString __fastcall GetNetFileDir(void);
- System::AnsiString __fastcall GetPrivateDir(void);
- void __fastcall InitializeBDE(void);
- void __fastcall InternalAddAlias(const System::AnsiString Name, const System::AnsiString Driver, Classes::TStrings*
- List, TConfigMode CfgMode, bool RestoreMode);
- void __fastcall InternalDeleteAlias(const System::AnsiString Name, TConfigMode CfgMode, bool RestoreMode
- );
- bool __fastcall SessionNameStored(void);
- void __fastcall LoadSMClient(bool DesignTime);
- void __fastcall LockSession(void);
- void __fastcall MakeCurrent(void);
- void __fastcall RegisterCallbacks(bool Value);
- void __fastcall RemoveDatabase(TDatabase* Value);
- Bde::CBRType __fastcall ServerCallback(void * CBInfo);
- void __fastcall SetActive(bool Value);
- void __fastcall SetAutoSessionName(bool Value);
- void __fastcall SetConfigMode(TConfigMode Value);
- void __fastcall SetConfigParams(const System::AnsiString Path, const System::AnsiString Node, Classes::TStrings*
- List);
- void __fastcall SetNetFileDir(const System::AnsiString Value);
- void __fastcall SetPrivateDir(const System::AnsiString Value);
- void __fastcall SetSessionName(const System::AnsiString Value);
- void __fastcall SetSessionNames(void);
- void __fastcall SetTraceFlags(TTraceFlags Value);
- void __fastcall SMClientSignal(System::TObject* Sender, int Data);
- Bde::CBRType __fastcall SqlTraceCallback(void * CBInfo);
- void __fastcall StartSession(bool Value);
- void __fastcall UnlockSession(void);
- void __fastcall UpdateAutoSessionName(void);
- void __fastcall ValidateAutoSession(Classes::TComponent* AOwner, bool AllSessions);
-
- protected:
- virtual void __fastcall Loaded(void);
- void __fastcall ModifyConfigParams(const System::AnsiString Path, const System::AnsiString Node, Classes::TStrings*
- List);
- virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
- );
- __property TDatabaseNotifyEvent OnDBNotify = {read=FOnDBNotify, write=FOnDBNotify};
- __property bool BDEOwnsLoginCbDb = {read=FBDEOwnsLoginCbDb, write=FBDEOwnsLoginCbDb, nodefault};
- virtual void __fastcall SetName(const System::AnsiString NewName);
-
- public:
- __fastcall virtual TSession(Classes::TComponent* AOwner);
- __fastcall virtual ~TSession(void);
- void __fastcall AddAlias(const System::AnsiString Name, const System::AnsiString Driver, Classes::TStrings*
- List);
- void __fastcall AddDriver(const System::AnsiString Name, Classes::TStrings* List);
- void __fastcall AddStandardAlias(const System::AnsiString Name, const System::AnsiString Path, const
- System::AnsiString DefaultDriver);
- __property TConfigMode ConfigMode = {read=GetConfigMode, write=SetConfigMode, nodefault};
- void __fastcall AddPassword(const System::AnsiString Password);
- void __fastcall Close(void);
- void __fastcall CloseDatabase(TDatabase* Database);
- void __fastcall DeleteAlias(const System::AnsiString Name);
- void __fastcall DeleteDriver(const System::AnsiString Name);
- void __fastcall DropConnections(void);
- TDatabase* __fastcall FindDatabase(const System::AnsiString DatabaseName);
- void __fastcall GetAliasNames(Classes::TStrings* List);
- void __fastcall GetAliasParams(const System::AnsiString AliasName, Classes::TStrings* List);
- System::AnsiString __fastcall GetAliasDriverName(const System::AnsiString AliasName);
- void __fastcall GetConfigParams(const System::AnsiString Path, const System::AnsiString Section, Classes::TStrings*
- List);
- void __fastcall GetDatabaseNames(Classes::TStrings* List);
- void __fastcall GetDriverNames(Classes::TStrings* List);
- void __fastcall GetDriverParams(const System::AnsiString DriverName, Classes::TStrings* List);
- bool __fastcall GetPassword(void);
- void __fastcall GetTableNames(const System::AnsiString DatabaseName, const System::AnsiString Pattern
- , bool Extensions, bool SystemTables, Classes::TStrings* List);
- void __fastcall GetStoredProcNames(const System::AnsiString DatabaseName, Classes::TStrings* List);
-
- bool __fastcall IsAlias(const System::AnsiString Name);
- void __fastcall ModifyAlias(System::AnsiString Name, Classes::TStrings* List);
- void __fastcall ModifyDriver(System::AnsiString Name, Classes::TStrings* List);
- void __fastcall Open(void);
- TDatabase* __fastcall OpenDatabase(const System::AnsiString DatabaseName);
- void __fastcall RemoveAllPasswords(void);
- void __fastcall RemovePassword(const System::AnsiString Password);
- void __fastcall SaveConfigFile(void);
- __property int DatabaseCount = {read=GetDatabaseCount, nodefault};
- __property TDatabase* Databases[int Index] = {read=GetDatabase};
- __property Bde::hDBISes Handle = {read=GetHandle};
- __property void * Locale = {read=FLocale};
- __property TTraceFlags TraceFlags = {read=FTraceFlags, write=SetTraceFlags, nodefault};
-
- __published:
- __property bool Active = {read=GetActive, write=SetActive, default=0};
- __property bool AutoSessionName = {read=FAutoSessionName, write=SetAutoSessionName, default=0};
- __property bool KeepConnections = {read=FKeepConnections, write=FKeepConnections, default=1};
- __property System::AnsiString NetFileDir = {read=GetNetFileDir, write=SetNetFileDir};
- __property System::AnsiString PrivateDir = {read=GetPrivateDir, write=SetPrivateDir};
- __property System::AnsiString SessionName = {read=FSessionName, write=SetSessionName, stored=SessionNameStored
- };
- __property bool SQLHourGlass = {read=FSQLHourGlass, write=FSQLHourGlass, default=1};
- __property TPasswordEvent OnPassword = {read=FOnPassword, write=FOnPassword};
- __property Classes::TNotifyEvent OnStartup = {read=FOnStartup, write=FOnStartup};
- };
-
- class DELPHICLASS TParamList;
- class PASCALIMPLEMENTATION TParamList : public System::TObject
- {
- typedef System::TObject inherited;
-
- private:
- int FFieldCount;
- Word FBufSize;
- TFieldDescList *FFieldDescs;
- char *FBuffer;
-
- public:
- __fastcall TParamList(Classes::TStrings* Params);
- __fastcall virtual ~TParamList(void);
- __property char * Buffer = {read=FBuffer};
- __property int FieldCount = {read=FFieldCount, nodefault};
- __property PFieldDescList FieldDescs = {read=FFieldDescs};
- };
-
- enum TTransIsolation { tiDirtyRead, tiReadCommitted, tiRepeatableRead };
-
- typedef void __fastcall (__closure *TLoginEvent)(TDatabase* Database, Classes::TStrings* LoginParams
- );
-
- class DELPHICLASS TDBDataSet;
- class PASCALIMPLEMENTATION TDatabase : public Classes::TComponent
- {
- typedef Classes::TComponent inherited;
-
- private:
- Classes::TList* FDataSets;
- TTransIsolation FTransIsolation;
- bool FLoginPrompt;
- bool FKeepConnection;
- bool FTemporary;
- bool FSessionAlias;
- bool FStreamedConnected;
- bool FLocaleLoaded;
- bool FAliased;
- bool FSQLBased;
- bool FAcquiredHandle;
- bool FPseudoIndexes;
- bool FHandleShared;
- int FRefCount;
- Bde::_hDBIObj *FHandle;
- void *FLocale;
- TSession* FSession;
- Classes::TStrings* FParams;
- System::AnsiString FSessionName;
- System::AnsiString FDatabaseName;
- System::AnsiString FDatabaseType;
- TLoginEvent FOnLogin;
- void __fastcall CheckActive(void);
- void __fastcall CheckInactive(void);
- void __fastcall CheckDatabaseName(void);
- void __fastcall CheckDatabaseAlias(System::AnsiString &Password);
- void __fastcall CheckSessionName(bool Required);
- void __fastcall EndTransaction(Bde::eXEnd TransEnd);
- System::AnsiString __fastcall GetAliasName(void);
- bool __fastcall GetConnected(void);
- TDBDataSet* __fastcall GetDataSet(int Index);
- int __fastcall GetDataSetCount(void);
- System::AnsiString __fastcall GetDirectory(void);
- System::AnsiString __fastcall GetDriverName(void);
- bool __fastcall GetInTransaction(void);
- TTraceFlags __fastcall GetTraceFlags(void);
- void __fastcall LoadLocale(void);
- void __fastcall Login(Classes::TStrings* LoginParams);
- bool __fastcall OpenFromExistingDB(void);
- void __fastcall ParamsChanging(System::TObject* Sender);
- void __fastcall SetAliasName(const System::AnsiString Value);
- void __fastcall SetConnected(bool Value);
- void __fastcall SetDatabaseFlags(void);
- void __fastcall SetDatabaseName(const System::AnsiString Value);
- void __fastcall SetDatabaseType(const System::AnsiString Value, bool Aliased);
- void __fastcall SetDirectory(const System::AnsiString Value);
- void __fastcall SetDriverName(const System::AnsiString Value);
- void __fastcall SetHandle(Bde::hDBIDb Value);
- void __fastcall SetKeepConnection(bool Value);
- void __fastcall SetParams(Classes::TStrings* Value);
- void __fastcall SetTraceFlags(TTraceFlags Value);
- void __fastcall SetSessionName(const System::AnsiString Value);
-
- protected:
- virtual void __fastcall Loaded(void);
- virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
- );
-
- public:
- __fastcall virtual TDatabase(Classes::TComponent* AOwner);
- __fastcall virtual ~TDatabase(void);
- void __fastcall ApplyUpdates(TDBDataSet* const * DataSets, const int DataSets_Size);
- void __fastcall Close(void);
- void __fastcall CloseDataSets(void);
- void __fastcall Commit(void);
- void __fastcall FlushSchemaCache(const System::AnsiString TableName);
- void __fastcall Open(void);
- void __fastcall Rollback(void);
- void __fastcall StartTransaction(void);
- void __fastcall ValidateName(const System::AnsiString Name);
- __property int DataSetCount = {read=GetDataSetCount, nodefault};
- __property TDBDataSet* DataSets[int Index] = {read=GetDataSet};
- __property System::AnsiString Directory = {read=GetDirectory, write=SetDirectory};
- __property Bde::hDBIDb Handle = {read=FHandle, write=SetHandle};
- __property bool IsSQLBased = {read=FSQLBased, nodefault};
- __property bool InTransaction = {read=GetInTransaction, nodefault};
- __property void * Locale = {read=FLocale};
- __property TSession* Session = {read=FSession};
- __property bool Temporary = {read=FTemporary, write=FTemporary, nodefault};
- __property bool SessionAlias = {read=FSessionAlias, nodefault};
- __property TTraceFlags TraceFlags = {read=GetTraceFlags, write=SetTraceFlags, nodefault};
-
- __published:
- __property System::AnsiString AliasName = {read=GetAliasName, write=SetAliasName};
- __property bool Connected = {read=GetConnected, write=SetConnected, default=0};
- __property System::AnsiString DatabaseName = {read=FDatabaseName, write=SetDatabaseName};
- __property System::AnsiString DriverName = {read=GetDriverName, write=SetDriverName};
- __property bool HandleShared = {read=FHandleShared, write=FHandleShared, default=0};
- __property bool KeepConnection = {read=FKeepConnection, write=SetKeepConnection, default=1};
- __property bool LoginPrompt = {read=FLoginPrompt, write=FLoginPrompt, default=1};
- __property Classes::TStrings* Params = {read=FParams, write=SetParams};
- __property System::AnsiString SessionName = {read=FSessionName, write=SetSessionName};
- __property TTransIsolation TransIsolation = {read=FTransIsolation, write=FTransIsolation, default=1
- };
- __property TLoginEvent OnLogin = {read=FOnLogin, write=FOnLogin};
- };
-
- enum TRecNoStatus { rnDbase, rnParadox, rnNotSupported };
-
- enum TUpdateAction { uaFail, uaAbort, uaSkip, uaRetry, uaApplied };
-
- enum DBTables__9 { rtModified, rtInserted, rtDeleted, rtUnmodified };
-
- typedef Set<DBTables__9, rtModified, rtUnmodified> TUpdateRecordTypes;
-
- typedef void __fastcall (__closure *TUpdateErrorEvent)(Db::TDataSet* DataSet, Db::EDatabaseError* E,
- Db::TUpdateKind UpdateKind, TUpdateAction &UpdateAction);
-
- typedef void __fastcall (__closure *TUpdateRecordEvent)(Db::TDataSet* DataSet, Db::TUpdateKind UpdateKind
- , TUpdateAction &UpdateAction);
-
- typedef void __fastcall (__closure *TOnServerYieldEvent)(Db::TDataSet* DataSet, bool &AbortQuery);
-
- class DELPHICLASS TDataSetUpdateObject;
- class DELPHICLASS TBDEDataSet;
- class PASCALIMPLEMENTATION TDataSetUpdateObject : public Classes::TComponent
- {
- typedef Classes::TComponent inherited;
-
- protected:
- virtual TBDEDataSet* __fastcall GetDataSet(void) = 0;
- virtual void __fastcall SetDataSet(TBDEDataSet* ADataSet) = 0;
- virtual void __fastcall Apply(Db::TUpdateKind UpdateKind) = 0;
- __property TBDEDataSet* DataSet = {read=GetDataSet, write=SetDataSet};
- public:
- /* TComponent.Create */ __fastcall virtual TDataSetUpdateObject(Classes::TComponent* AOwner) : Classes::
- TComponent(AOwner) { }
- /* TComponent.Destroy */ __fastcall virtual ~TDataSetUpdateObject(void) { }
-
- };
-
- enum TKeyIndex { kiLookup, kiRangeStart, kiRangeEnd, kiCurRangeStart, kiCurRangeEnd, kiSave };
-
- struct TKeyBuffer;
- typedef TKeyBuffer *PKeyBuffer;
-
- #pragma pack(push, 1)
- struct DBTables__11
- {
-
- } ;
- #pragma pack(pop)
-
- struct TKeyBuffer
- {
- bool Modified;
- bool Exclusive;
- int FieldCount;
- DBTables__11 Data;
- } ;
-
- struct TRecInfo;
- typedef TRecInfo *PRecInfo;
-
- struct TRecInfo
- {
- int RecordNumber;
- TUpdateStatus UpdateStatus;
- TBookmarkFlag BookmarkFlag;
- } ;
-
- typedef System::AnsiString TBlobData;
-
- typedef System::AnsiString TBlobDataArray[1];
-
- typedef TBlobDataArray *PBlobDataArray;
-
- class PASCALIMPLEMENTATION TBDEDataSet : public Db::TDataSet
- {
- typedef Db::TDataSet inherited;
-
- private:
- Bde::_hDBIObj *FHandle;
- Bde::RECProps FRecProps;
- void *FLocale;
- Bde::_hDBIObj *FExprFilter;
- Bde::_hDBIObj *FFuncFilter;
- char *FFilterBuffer;
- Word FIndexFieldMap[16];
- bool FExpIndex;
- bool FCaseInsIndex;
- bool FCachedUpdates;
- bool FInUpdateCallback;
- bool FCanModify;
- bool FCacheBlobs;
- Word FKeySize;
- Bde::DELAYUPDCbDesc *FUpdateCBBuf;
- TBDECallback* FUpdateCallback;
- TBDECallback* FAsyncCallback;
- CBYieldStep FCBYieldStep;
- TKeyBuffer *FKeyBuffers[6];
- TKeyBuffer *FKeyBuffer;
- TRecNoStatus FRecNoStatus;
- int FIndexFieldCount;
- int FConstDisableCount;
- Word FRecordSize;
- Word FBookmarkOfs;
- Word FRecInfoOfs;
- Word FBlobCacheOfs;
- Word FRecBufSize;
- bool FConstraintLayer;
- Stdvcl::_di_IProvider FProvIntf;
- TOnServerYieldEvent FOnServerYield;
- TDataSetUpdateObject* FUpdateObject;
- TUpdateErrorEvent FOnUpdateError;
- TUpdateRecordEvent FOnUpdateRecord;
- void __fastcall ClearBlobCache(char * Buffer);
- bool __fastcall GetActiveRecBuf(char * &RecBuf);
- System::AnsiString __fastcall GetBlobData(Db::TField* Field, char * Buffer);
- char * __fastcall GetOldRecord(void);
- void __fastcall InitBufferPointers(bool GetProps);
- short __stdcall RecordFilter(void * RecBuf, int RecNo);
- void __fastcall SetBlobData(Db::TField* Field, char * Buffer, System::AnsiString Value);
- bool __fastcall HasConstraints(void);
-
- protected:
- void __fastcall ActivateFilters(void);
- void __fastcall AddFieldDesc(const Bde::FLDDesc &FieldDesc, bool ARequired);
- void __fastcall AllocCachedUpdateBuffers(bool Allocate);
- void __fastcall AllocKeyBuffers(void);
- virtual char * __fastcall AllocRecordBuffer(void);
- virtual bool __fastcall BCDToCurr(void * BCD, System::Currency &Curr);
- virtual bool __fastcall CurrToBCD(const System::Currency Curr, void * BCD, int Precision, int Decimals
- );
- Bde::CBRType __fastcall CachedUpdateCallBack(void * CBInfo);
- void __fastcall CheckCachedUpdateMode(void);
- void __fastcall CheckSetKeyMode(void);
- virtual void __fastcall ClearCalcFields(char * Buffer);
- virtual void __fastcall CloseCursor(void);
- virtual void __fastcall CloseBlob(Db::TField* Field);
- Bde::hDBIFilter __fastcall CreateExprFilter(const System::AnsiString Expr, Db::TFilterOptions Options
- , int Priority);
- Bde::hDBIFilter __fastcall CreateFuncFilter(void * FilterFunc, int Priority);
- virtual Bde::hDBICur __fastcall CreateHandle(void);
- Bde::hDBIFilter __fastcall CreateLookupFilter(Classes::TList* Fields, const System::Variant &Values
- , Db::TLocateOptions Options, int Priority);
- void __fastcall DeactivateFilters(void);
- virtual void __fastcall DestroyHandle(void);
- virtual void __fastcall DestroyLookupCursor(void);
- virtual bool __fastcall FindRecord(bool Restart, bool GoForward);
- bool __fastcall ForceUpdateCallback(void);
- void __fastcall FreeKeyBuffers(void);
- virtual void __fastcall FreeRecordBuffer(char * &Buffer);
- virtual void __fastcall GetBookmarkData(char * Buffer, void * Data);
- virtual Db::TBookmarkFlag __fastcall GetBookmarkFlag(char * Buffer);
- virtual bool __fastcall GetCanModify(void);
- virtual bool __fastcall GetFieldData(Db::TField* Field, void * Buffer);
- Db::TField* __fastcall GetIndexField(int Index);
- int __fastcall GetIndexFieldCount(void);
- virtual bool __fastcall GetIsIndexField(Db::TField* Field);
- PKeyBuffer __fastcall GetKeyBuffer(TKeyIndex KeyIndex);
- bool __fastcall GetKeyExclusive(void);
- int __fastcall GetKeyFieldCount(void);
- virtual Bde::hDBICur __fastcall GetLookupCursor(const System::AnsiString KeyFields, bool CaseInsensitive
- );
- virtual Db::TGetResult __fastcall GetRecord(char * Buffer, Db::TGetMode GetMode, bool DoCheck);
- virtual int __fastcall GetRecordCount(void);
- virtual int __fastcall GetRecNo(void);
- virtual Word __fastcall GetRecordSize(void);
- virtual System::Variant __fastcall GetStateFieldValue(Db::TDataSetState State, Db::TField* Field);
- bool __fastcall GetUpdatesPending(void);
- TUpdateRecordTypes __fastcall GetUpdateRecordSet(void);
- PKeyBuffer __fastcall InitKeyBuffer(PKeyBuffer Buffer);
- virtual void __fastcall InitRecord(char * Buffer);
- virtual void __fastcall InternalAddRecord(void * Buffer, bool Append);
- virtual void __fastcall InternalCancel(void);
- virtual void __fastcall InternalClose(void);
- virtual void __fastcall InternalDelete(void);
- virtual void __fastcall InternalEdit(void);
- virtual void __fastcall InternalFirst(void);
- virtual void __fastcall InternalGotoBookmark(void * Bookmark);
- virtual void __fastcall InternalHandleException(void);
- virtual void __fastcall InternalInitFieldDefs(void);
- virtual void __fastcall InternalInitRecord(char * Buffer);
- virtual void __fastcall InternalLast(void);
- virtual void __fastcall InternalOpen(void);
- virtual void __fastcall InternalPost(void);
- virtual void __fastcall InternalRefresh(void);
- virtual void __fastcall InternalSetToRecord(char * Buffer);
- virtual bool __fastcall IsCursorOpen(void);
- bool __fastcall LocateRecord(const System::AnsiString KeyFields, const System::Variant &KeyValues,
- Db::TLocateOptions Options, bool SyncCursor);
- bool __fastcall MapsToIndex(Classes::TList* Fields, bool CaseInsensitive);
- virtual void __fastcall OpenCursor(bool InfoQuery);
- void __fastcall PostKeyBuffer(bool Commit);
- virtual void __fastcall PrepareCursor(void);
- Word __fastcall ProcessUpdates(Bde::DBIDelayedUpdCmd UpdCmd);
- bool __fastcall ResetCursorRange(void);
- virtual void __fastcall SetBookmarkData(char * Buffer, void * Data);
- virtual void __fastcall SetBookmarkFlag(char * Buffer, Db::TBookmarkFlag Value);
- void __fastcall SetCachedUpdates(bool Value);
- bool __fastcall SetCursorRange(void);
- virtual void __fastcall SetFieldData(Db::TField* Field, void * Buffer);
- void __fastcall SetFilterData(const System::AnsiString Text, Db::TFilterOptions Options);
- void __fastcall SetFilterHandle(Bde::hDBIFilter &Filter, Bde::hDBIFilter Value);
- virtual void __fastcall SetFiltered(bool Value);
- virtual void __fastcall SetFilterOptions(Db::TFilterOptions Value);
- virtual void __fastcall SetFilterText(const System::AnsiString Value);
- void __fastcall SetIndexField(int Index, Db::TField* Value);
- void __fastcall SetKeyBuffer(TKeyIndex KeyIndex, bool Clear);
- void __fastcall SetKeyExclusive(bool Value);
- void __fastcall SetKeyFieldCount(int Value);
- void __fastcall SetKeyFields(TKeyIndex KeyIndex, const System::TVarRec * Values, const int Values_Size
- );
- void __fastcall SetLinkRanges(Classes::TList* MasterFields);
- void __fastcall SetLocale(void * Value);
- virtual void __fastcall SetStateFieldValue(Db::TDataSetState State, Db::TField* Field, const System::Variant
- &Value);
- virtual void __fastcall SetOnFilterRecord(const Db::TFilterRecordEvent Value);
- void __fastcall SetOnUpdateError(TUpdateErrorEvent UpdateEvent);
- virtual void __fastcall SetRecNo(int Value);
- void __fastcall SetupCallBack(bool Value);
- void __fastcall SetUpdateRecordSet(TUpdateRecordTypes RecordTypes);
- void __fastcall SetUpdateObject(TDataSetUpdateObject* Value);
- void __fastcall SwitchToIndex(const System::AnsiString IndexName, const System::AnsiString TagName)
- ;
- bool __fastcall UpdateCallbackRequired(void);
- Bde::CBRType __fastcall YieldCallBack(void * CBInfo);
-
- public:
- __fastcall virtual TBDEDataSet(Classes::TComponent* AOwner);
- __fastcall virtual ~TBDEDataSet(void);
- void __fastcall ApplyUpdates(void);
- virtual bool __fastcall BookmarkValid(void * Bookmark);
- virtual void __fastcall Cancel(void);
- void __fastcall CancelUpdates(void);
- __property bool CacheBlobs = {read=FCacheBlobs, write=FCacheBlobs, default=1};
- virtual int __fastcall CompareBookmarks(void * Bookmark1, void * Bookmark2);
- void __fastcall CommitUpdates(void);
- Word __stdcall ConstraintCallBack(Bde::DsInfoReq Req, Bde::DataSources &ADataSources);
- bool __fastcall ConstraintsDisabled(void);
- virtual Classes::TStream* __fastcall CreateBlobStream(Db::TField* Field, Db::TBlobStreamMode Mode);
-
- void __fastcall DisableConstraints(void);
- void __fastcall EnableConstraints(void);
- void __fastcall FetchAll(void);
- void __fastcall FlushBuffers(void);
- virtual bool __fastcall GetCurrentRecord(char * Buffer);
- void __fastcall GetIndexInfo(void);
- virtual bool __fastcall Locate(const System::AnsiString KeyFields, const System::Variant &KeyValues
- , Db::TLocateOptions Options);
- virtual System::Variant __fastcall Lookup(const System::AnsiString KeyFields, const System::Variant
- &KeyValues, const System::AnsiString ResultFields);
- virtual bool __fastcall IsSequenced(void);
- virtual void __fastcall Post(void);
- void __fastcall RevertRecord(void);
- Db::TUpdateStatus __fastcall UpdateStatus(void);
- virtual void __fastcall Translate(char * Src, char * Dest, bool ToOem);
- __property bool ExpIndex = {read=FExpIndex, nodefault};
- __property Bde::hDBICur Handle = {read=FHandle};
- __property Word KeySize = {read=FKeySize, nodefault};
- __property void * Locale = {read=FLocale};
- __property TDataSetUpdateObject* UpdateObject = {read=FUpdateObject, write=SetUpdateObject};
- __property bool UpdatesPending = {read=GetUpdatesPending, nodefault};
- __property TUpdateRecordTypes UpdateRecordTypes = {read=GetUpdateRecordSet, write=SetUpdateRecordSet
- , nodefault};
-
- __published:
- __property Active ;
- __property AutoCalcFields ;
- __property bool CachedUpdates = {read=FCachedUpdates, write=SetCachedUpdates, default=0};
- __property Filter ;
- __property Filtered ;
- __property FilterOptions ;
- __property BeforeOpen ;
- __property AfterOpen ;
- __property BeforeClose ;
- __property AfterClose ;
- __property BeforeInsert ;
- __property AfterInsert ;
- __property BeforeEdit ;
- __property AfterEdit ;
- __property BeforePost ;
- __property AfterPost ;
- __property BeforeCancel ;
- __property AfterCancel ;
- __property BeforeDelete ;
- __property AfterDelete ;
- __property BeforeScroll ;
- __property AfterScroll ;
- __property OnCalcFields ;
- __property OnDeleteError ;
- __property OnEditError ;
- __property OnFilterRecord ;
- __property OnNewRecord ;
- __property OnPostError ;
- __property TOnServerYieldEvent OnServerYield = {read=FOnServerYield, write=FOnServerYield};
- __property TUpdateErrorEvent OnUpdateError = {read=FOnUpdateError, write=SetOnUpdateError};
- __property TUpdateRecordEvent OnUpdateRecord = {read=FOnUpdateRecord, write=FOnUpdateRecord};
- };
-
- enum TUpdateMode { upWhereAll, upWhereChanged, upWhereKeyOnly };
-
- typedef Set<Shortint, 0, 15> TDBFlags;
-
- class PASCALIMPLEMENTATION TDBDataSet : public Dbtables::TBDEDataSet
- {
- typedef Dbtables::TBDEDataSet inherited;
-
- private:
- TDBFlags FDBFlags;
- TUpdateMode FUpdateMode;
- TDatabase* FDatabase;
- System::AnsiString FDatabaseName;
- System::AnsiString FSessionName;
- void __fastcall CheckDBSessionName(void);
- Bde::hDBIDb __fastcall GetDBHandle(void);
- void * __fastcall GetDBLocale(void);
- TSession* __fastcall GetDBSession(void);
- void __fastcall SetDatabaseName(const System::AnsiString Value);
- void __fastcall SetSessionName(const System::AnsiString Value);
- void __fastcall SetUpdateMode(const TUpdateMode Value);
-
- protected:
- virtual void __fastcall CloseCursor(void);
- bool __fastcall ConstraintsStored(void);
- virtual void __fastcall Disconnect(void);
- virtual Stdvcl::_di_IProvider __fastcall GetProvider(void);
- virtual void __fastcall OpenCursor(bool InfoQuery);
- virtual bool __fastcall SetDBFlag(int Flag, bool Value);
- __property TDBFlags DBFlags = {read=FDBFlags, nodefault};
- __property TUpdateMode UpdateMode = {read=FUpdateMode, write=SetUpdateMode, default=0};
-
- public:
- bool __fastcall CheckOpen(Word Status);
- void __fastcall CloseDatabase(TDatabase* Database);
- TDatabase* __fastcall OpenDatabase(void);
- __property TDatabase* Database = {read=FDatabase};
- __property Bde::hDBIDb DBHandle = {read=GetDBHandle};
- __property void * DBLocale = {read=GetDBLocale};
- __property TSession* DBSession = {read=GetDBSession};
- __property Stdvcl::_di_IProvider Provider = {read=GetProvider};
-
- __published:
- __property System::AnsiString DatabaseName = {read=FDatabaseName, write=SetDatabaseName};
- __property System::AnsiString SessionName = {read=FSessionName, write=SetSessionName};
- public:
- /* TBDEDataSet.Create */ __fastcall virtual TDBDataSet(Classes::TComponent* AOwner) : Dbtables::TBDEDataSet(
- AOwner) { }
- /* TBDEDataSet.Destroy */ __fastcall virtual ~TDBDataSet(void) { }
-
- };
-
- enum TBatchMode { batAppend, batUpdate, batAppendUpdate, batDelete, batCopy };
-
- enum TTableType { ttDefault, ttParadox, ttDBase, ttFoxPro, ttASCII };
-
- enum TLockType { ltReadLock, ltWriteLock };
-
- typedef System::AnsiString TIndexName;
-
- class DELPHICLASS TIndexFiles;
- class DELPHICLASS TTable;
- class PASCALIMPLEMENTATION TTable : public Dbtables::TDBDataSet
- {
- typedef Dbtables::TDBDataSet inherited;
-
- private:
- bool FStoreDefs;
- Db::TIndexDefs* FIndexDefs;
- Dbcommon::TMasterDataLink* FMasterLink;
- bool FExclusive;
- bool FReadOnly;
- TTableType FTableType;
- bool FFieldsIndex;
- System::AnsiString FTableName;
- System::AnsiString FIndexName;
- Classes::TStrings* FIndexFiles;
- Bde::_hDBIObj *FLookupHandle;
- System::AnsiString FLookupKeyFields;
- int FTableLevel;
- bool FLookupCaseIns;
- void __fastcall CheckMasterRange(void);
- void __fastcall DecodeIndexDesc(const Bde::IDXDesc &IndexDesc, System::AnsiString &Source, System::AnsiString
- &Name, System::AnsiString &FieldExpression, Db::TIndexOptions &Options);
- bool __fastcall FieldDefsStored(void);
- char * __fastcall GetDriverTypeName(char * Buffer);
- bool __fastcall GetExists(void);
- System::AnsiString __fastcall GetIndexFieldNames(void);
- System::AnsiString __fastcall GetIndexName(void);
- void __fastcall GetIndexParams(const System::AnsiString IndexName, bool FieldsIndex, System::AnsiString
- &IndexedName, System::AnsiString &IndexTag);
- System::AnsiString __fastcall GetMasterFields(void);
- char * __fastcall GetTableTypeName(void);
- int __fastcall GetTableLevel(void);
- bool __fastcall IndexDefsStored(void);
- bool __fastcall IsXBaseTable(void);
- void __fastcall MasterChanged(System::TObject* Sender);
- void __fastcall MasterDisabled(System::TObject* Sender);
- void __fastcall SetDataSource(Db::TDataSource* Value);
- void __fastcall SetExclusive(bool Value);
- void __fastcall SetIndexDefs(Db::TIndexDefs* Value);
- void __fastcall SetIndex(const System::AnsiString Value, bool FieldsIndex);
- void __fastcall SetIndexFieldNames(const System::AnsiString Value);
- void __fastcall SetIndexFiles(Classes::TStrings* Value);
- void __fastcall SetIndexName(const System::AnsiString Value);
- void __fastcall SetMasterFields(const System::AnsiString Value);
- void __fastcall SetReadOnly(bool Value);
- void __fastcall SetTableLock(TLockType LockType, bool Lock);
- void __fastcall SetTableName(const System::AnsiString Value);
- void __fastcall SetTableType(TTableType Value);
- void * __fastcall SetTempLocale(bool ActiveCheck);
- void __fastcall RestoreLocale(void * LocaleSave);
- void __fastcall UpdateRange(void);
-
- protected:
- virtual Bde::hDBICur __fastcall CreateHandle(void);
- virtual void __fastcall DataEvent(Db::TDataEvent Event, int Info);
- virtual void __fastcall DefChanged(System::TObject* Sender);
- virtual void __fastcall DestroyHandle(void);
- virtual void __fastcall DestroyLookupCursor(void);
- virtual void __fastcall DoOnNewRecord(void);
- void __fastcall EncodeFieldDesc(Bde::FLDDesc &FieldDesc, const System::AnsiString Name, Db::TFieldType
- DataType, Word Size);
- void __fastcall EncodeIndexDesc(Bde::IDXDesc &IndexDesc, const System::AnsiString Name, const System::AnsiString
- FieldExpression, Db::TIndexOptions Options);
- virtual bool __fastcall GetCanModify(void);
- virtual Db::TDataSource* __fastcall GetDataSource(void);
- Bde::hDBICur __fastcall GetHandle(const System::AnsiString IndexName, const System::AnsiString IndexTag
- );
- System::AnsiString __fastcall GetLanguageDriverName(void);
- virtual Bde::hDBICur __fastcall GetLookupCursor(const System::AnsiString KeyFields, bool CaseInsensitive
- );
- virtual void __fastcall InitFieldDefs(void);
- bool __fastcall IsProductionIndex(const System::AnsiString IndexName);
- System::AnsiString __fastcall GetFileName(void);
- TTableType __fastcall GetTableType(void);
- virtual void __fastcall PrepareCursor(void);
- virtual void __fastcall UpdateIndexDefs(void);
- __property Dbcommon::TMasterDataLink* MasterLink = {read=FMasterLink};
-
- public:
- __fastcall virtual TTable(Classes::TComponent* AOwner);
- __fastcall virtual ~TTable(void);
- int __fastcall BatchMove(TBDEDataSet* ASource, TBatchMode AMode);
- void __fastcall AddIndex(const System::AnsiString Name, const System::AnsiString Fields, Db::TIndexOptions
- Options);
- void __fastcall ApplyRange(void);
- void __fastcall CancelRange(void);
- void __fastcall CloseIndexFile(const System::AnsiString IndexFileName);
- void __fastcall CreateTable(void);
- void __fastcall DeleteIndex(const System::AnsiString Name);
- void __fastcall DeleteTable(void);
- void __fastcall EditKey(void);
- void __fastcall EditRangeEnd(void);
- void __fastcall EditRangeStart(void);
- void __fastcall EmptyTable(void);
- bool __fastcall FindKey(const System::TVarRec * KeyValues, const int KeyValues_Size);
- void __fastcall FindNearest(const System::TVarRec * KeyValues, const int KeyValues_Size);
- void __fastcall GetIndexNames(Classes::TStrings* List);
- void __fastcall GotoCurrent(TTable* Table);
- bool __fastcall GotoKey(void);
- void __fastcall GotoNearest(void);
- void __fastcall LockTable(TLockType LockType);
- void __fastcall OpenIndexFile(const System::AnsiString IndexName);
- void __fastcall RenameTable(const System::AnsiString NewTableName);
- void __fastcall SetKey(void);
- void __fastcall SetRange(const System::TVarRec * StartValues, const int StartValues_Size, const System::TVarRec
- * EndValues, const int EndValues_Size);
- void __fastcall SetRangeEnd(void);
- void __fastcall SetRangeStart(void);
- void __fastcall UnlockTable(TLockType LockType);
- __property bool Exists = {read=GetExists, nodefault};
- __property int IndexFieldCount = {read=GetIndexFieldCount, nodefault};
- __property Db::TField* IndexFields[int Index] = {read=GetIndexField, write=SetIndexField};
- __property bool KeyExclusive = {read=GetKeyExclusive, write=SetKeyExclusive, nodefault};
- __property int KeyFieldCount = {read=GetKeyFieldCount, write=SetKeyFieldCount, nodefault};
- __property int TableLevel = {read=GetTableLevel, write=FTableLevel, nodefault};
-
- __published:
- __property Constraints = {stored=ConstraintsStored};
- __property bool Exclusive = {read=FExclusive, write=SetExclusive, default=0};
- __property FieldDefs = {stored=FieldDefsStored};
- __property Db::TIndexDefs* IndexDefs = {read=FIndexDefs, write=SetIndexDefs, stored=IndexDefsStored
- };
- __property System::AnsiString IndexFieldNames = {read=GetIndexFieldNames, write=SetIndexFieldNames}
- ;
- __property Classes::TStrings* IndexFiles = {read=FIndexFiles, write=SetIndexFiles};
- __property System::AnsiString IndexName = {read=GetIndexName, write=SetIndexName};
- __property System::AnsiString MasterFields = {read=GetMasterFields, write=SetMasterFields};
- __property Db::TDataSource* MasterSource = {read=GetDataSource, write=SetDataSource};
- __property bool ReadOnly = {read=FReadOnly, write=SetReadOnly, default=0};
- __property bool StoreDefs = {read=FStoreDefs, write=FStoreDefs, default=0};
- __property System::AnsiString TableName = {read=FTableName, write=SetTableName};
- __property TTableType TableType = {read=FTableType, write=SetTableType, default=0};
- __property UpdateMode ;
- __property UpdateObject ;
- };
-
- class PASCALIMPLEMENTATION TIndexFiles : public Classes::TStringList
- {
- typedef Classes::TStringList inherited;
-
- private:
- TTable* FOwner;
-
- public:
- __fastcall TIndexFiles(TTable* AOwner);
- virtual int __fastcall Add(const System::AnsiString S);
- virtual void __fastcall Clear(void);
- virtual void __fastcall Delete(int Index);
- virtual void __fastcall Insert(int Index, const System::AnsiString S);
- public:
- /* TStringList.Destroy */ __fastcall virtual ~TIndexFiles(void) { }
-
- };
-
- class DELPHICLASS TBatchMove;
- class PASCALIMPLEMENTATION TBatchMove : public Classes::TComponent
- {
- typedef Classes::TComponent inherited;
-
- private:
- TTable* FDestination;
- TBDEDataSet* FSource;
- TBatchMode FMode;
- bool FAbortOnKeyViol;
- bool FAbortOnProblem;
- bool FTransliterate;
- int FRecordCount;
- int FMovedCount;
- int FKeyViolCount;
- int FProblemCount;
- int FChangedCount;
- Classes::TStrings* FMappings;
- System::AnsiString FKeyViolTableName;
- System::AnsiString FProblemTableName;
- System::AnsiString FChangedTableName;
- int FCommitCount;
- char * __fastcall ConvertName(const System::AnsiString Name, char * Buffer);
- void __fastcall SetMappings(Classes::TStrings* Value);
- void __fastcall SetSource(TBDEDataSet* Value);
-
- protected:
- virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
- );
-
- public:
- __fastcall virtual TBatchMove(Classes::TComponent* AOwner);
- __fastcall virtual ~TBatchMove(void);
- void __fastcall Execute(void);
- __property int ChangedCount = {read=FChangedCount, nodefault};
- __property int KeyViolCount = {read=FKeyViolCount, nodefault};
- __property int MovedCount = {read=FMovedCount, nodefault};
- __property int ProblemCount = {read=FProblemCount, nodefault};
-
- __published:
- __property bool AbortOnKeyViol = {read=FAbortOnKeyViol, write=FAbortOnKeyViol, default=1};
- __property bool AbortOnProblem = {read=FAbortOnProblem, write=FAbortOnProblem, default=1};
- __property int CommitCount = {read=FCommitCount, write=FCommitCount, default=0};
- __property System::AnsiString ChangedTableName = {read=FChangedTableName, write=FChangedTableName};
-
- __property TTable* Destination = {read=FDestination, write=FDestination};
- __property System::AnsiString KeyViolTableName = {read=FKeyViolTableName, write=FKeyViolTableName};
-
- __property Classes::TStrings* Mappings = {read=FMappings, write=SetMappings};
- __property TBatchMode Mode = {read=FMode, write=FMode, default=0};
- __property System::AnsiString ProblemTableName = {read=FProblemTableName, write=FProblemTableName};
-
- __property int RecordCount = {read=FRecordCount, write=FRecordCount, default=0};
- __property TBDEDataSet* Source = {read=FSource, write=SetSource};
- __property bool Transliterate = {read=FTransliterate, write=FTransliterate, default=1};
- };
-
- enum TParamType { ptUnknown, ptInput, ptOutput, ptInputOutput, ptResult };
-
- class DELPHICLASS TParam;
- class DELPHICLASS TParams;
- class PASCALIMPLEMENTATION TParams : public Classes::TPersistent
- {
- typedef Classes::TPersistent inherited;
-
- private:
- Classes::TList* FItems;
- TParam* __fastcall GetParam(Word Index);
- System::Variant __fastcall GetParamValue(const System::AnsiString ParamName);
- Word __fastcall GetVersion(void);
- void __fastcall ReadBinaryData(Classes::TStream* Stream);
- void __fastcall SetParamValue(const System::AnsiString ParamName, const System::Variant &Value);
- void __fastcall WriteBinaryData(Classes::TStream* Stream);
-
- protected:
- virtual void __fastcall AssignTo(Classes::TPersistent* Dest);
- virtual void __fastcall DefineProperties(Classes::TFiler* Filer);
-
- public:
- __fastcall virtual TParams(void);
- __fastcall virtual ~TParams(void);
- virtual void __fastcall Assign(Classes::TPersistent* Source);
- void __fastcall AssignValues(TParams* Value);
- void __fastcall AddParam(TParam* Value);
- void __fastcall RemoveParam(TParam* Value);
- TParam* __fastcall CreateParam(Db::TFieldType FldType, const System::AnsiString ParamName, TParamType
- ParamType);
- int __fastcall Count(void);
- void __fastcall Clear(void);
- void __fastcall GetParamList(Classes::TList* List, const System::AnsiString ParamNames);
- bool __fastcall IsEqual(TParams* Value);
- TParam* __fastcall ParamByName(const System::AnsiString Value);
- __property TParam* Items[Word Index] = {read=GetParam/*, default*/};
- __property System::Variant ParamValues[System::AnsiString ParamName] = {read=GetParamValue, write=SetParamValue
- };
- };
-
- class PASCALIMPLEMENTATION TParam : public Classes::TPersistent
- {
- typedef Classes::TPersistent inherited;
-
- private:
- TParams* FParamList;
- System::Variant FData;
- System::AnsiString FNativeStr;
- System::AnsiString FName;
- TFieldType FDataType;
- bool FNull;
- bool FBound;
- TParamType FParamType;
- void __fastcall InitValue(void);
-
- protected:
- void __fastcall AssignParam(TParam* Param);
- virtual void __fastcall AssignTo(Classes::TPersistent* Dest);
- System::Currency __fastcall GetAsBCD(void);
- bool __fastcall GetAsBoolean(void);
- System::TDateTime __fastcall GetAsDateTime(void);
- double __fastcall GetAsFloat(void);
- int __fastcall GetAsInteger(void);
- System::AnsiString __fastcall GetAsMemo(void);
- System::AnsiString __fastcall GetAsString(void);
- System::Variant __fastcall GetAsVariant(void);
- bool __fastcall IsEqual(TParam* Value);
- int __fastcall RecBufDataSize(void);
- void __fastcall RecBufGetData(void * Buffer, void * Locale);
- void __fastcall SetAsBCD(System::Currency Value);
- void __fastcall SetAsBlob(System::AnsiString Value);
- void __fastcall SetAsBoolean(bool Value);
- void __fastcall SetAsCurrency(double Value);
- void __fastcall SetAsDate(System::TDateTime Value);
- void __fastcall SetAsDateTime(System::TDateTime Value);
- void __fastcall SetAsFloat(double Value);
- void __fastcall SetAsInteger(int Value);
- void __fastcall SetAsMemo(const System::AnsiString Value);
- void __fastcall SetAsString(const System::AnsiString Value);
- void __fastcall SetAsSmallInt(int Value);
- void __fastcall SetAsTime(System::TDateTime Value);
- void __fastcall SetAsVariant(const System::Variant &Value);
- void __fastcall SetAsWord(int Value);
- void __fastcall SetDataType(Db::TFieldType Value);
- void __fastcall SetText(const System::AnsiString Value);
-
- public:
- __fastcall TParam(TParams* AParamList, TParamType AParamType);
- __fastcall virtual ~TParam(void);
- virtual void __fastcall Assign(Classes::TPersistent* Source);
- void __fastcall AssignField(Db::TField* Field);
- void __fastcall AssignFieldValue(Db::TField* Field, const System::Variant &Value);
- void __fastcall Clear(void);
- void __fastcall GetData(void * Buffer);
- int __fastcall GetDataSize(void);
- void __fastcall LoadFromFile(const System::AnsiString FileName, Db::TBlobType BlobType);
- void __fastcall LoadFromStream(Classes::TStream* Stream, Db::TBlobType BlobType);
- void __fastcall SetBlobData(void * Buffer, int Size);
- void __fastcall SetData(void * Buffer);
- __property System::Currency AsBCD = {read=GetAsBCD, write=SetAsBCD};
- __property System::AnsiString AsBlob = {read=GetAsString, write=SetAsBlob};
- __property bool AsBoolean = {read=GetAsBoolean, write=SetAsBoolean, nodefault};
- __property double AsCurrency = {read=GetAsFloat, write=SetAsCurrency};
- __property System::TDateTime AsDate = {read=GetAsDateTime, write=SetAsDate};
- __property System::TDateTime AsDateTime = {read=GetAsDateTime, write=SetAsDateTime};
- __property double AsFloat = {read=GetAsFloat, write=SetAsFloat};
- __property int AsInteger = {read=GetAsInteger, write=SetAsInteger, nodefault};
- __property int AsSmallInt = {read=GetAsInteger, write=SetAsSmallInt, nodefault};
- __property System::AnsiString AsMemo = {read=GetAsMemo, write=SetAsMemo};
- __property System::AnsiString AsString = {read=GetAsString, write=SetAsString};
- __property System::TDateTime AsTime = {read=GetAsDateTime, write=SetAsTime};
- __property int AsWord = {read=GetAsInteger, write=SetAsWord, nodefault};
- __property bool Bound = {read=FBound, write=FBound, nodefault};
- __property Db::TFieldType DataType = {read=FDataType, write=SetDataType, nodefault};
- __property bool IsNull = {read=FNull, nodefault};
- __property System::AnsiString Name = {read=FName, write=FName};
- __property TParamType ParamType = {read=FParamType, write=FParamType, nodefault};
- __property System::AnsiString Text = {read=GetAsString, write=SetText};
- __property System::Variant Value = {read=GetAsVariant, write=SetAsVariant};
- };
-
- struct TServerDesc;
- typedef TServerDesc *PServerDesc;
-
- #pragma pack(push, 1)
- struct TServerDesc
- {
- System::SmallString<64> ParamName;
- TFieldType BindType;
- } ;
- #pragma pack(pop)
-
- enum TParamBindMode { pbByName, pbByNumber };
-
- class DELPHICLASS TStoredProc;
- class PASCALIMPLEMENTATION TStoredProc : public Dbtables::TDBDataSet
- {
- typedef Dbtables::TDBDataSet inherited;
-
- private:
- Bde::_hDBIObj *FStmtHandle;
- System::AnsiString FProcName;
- TParams* FParams;
- char *FParamDesc;
- char *FRecordBuffer;
- Word FOverLoad;
- bool FPrepared;
- bool FQueryMode;
- char *FServerDescs;
- TParamBindMode FBindMode;
- void __fastcall BindParams(void);
- bool __fastcall CheckServerParams(void);
- Bde::hDBICur __fastcall CreateCursor(bool GenHandle);
- void __fastcall CreateParamDesc(void);
- void __fastcall FreeStatement(void);
- Bde::hDBICur __fastcall GetCursor(bool GenHandle);
- void __fastcall PrepareProc(void);
- void __fastcall SetParamsList(TParams* Value);
- void __fastcall SetServerParams(void);
-
- protected:
- virtual Bde::hDBICur __fastcall CreateHandle(void);
- virtual void __fastcall Disconnect(void);
- Word __fastcall GetParamsCount(void);
- virtual bool __fastcall SetDBFlag(int Flag, bool Value);
- void __fastcall SetOverLoad(Word Value);
- void __fastcall SetProcName(const System::AnsiString Value);
- void __fastcall SetPrepared(bool Value);
- void __fastcall SetPrepare(bool Value);
-
- public:
- __fastcall virtual TStoredProc(Classes::TComponent* AOwner);
- __fastcall virtual ~TStoredProc(void);
- void __fastcall CopyParams(TParams* Value);
- bool __fastcall DescriptionsAvailable(void);
- void __fastcall ExecProc(void);
- TParam* __fastcall ParamByName(const System::AnsiString Value);
- void __fastcall Prepare(void);
- void __fastcall GetResults(void);
- void __fastcall UnPrepare(void);
- __property Word ParamCount = {read=GetParamsCount, nodefault};
- __property Bde::hDBIStmt StmtHandle = {read=FStmtHandle};
- __property bool Prepared = {read=FPrepared, write=SetPrepare, nodefault};
-
- __published:
- __property System::AnsiString StoredProcName = {read=FProcName, write=SetProcName};
- __property Word Overload = {read=FOverLoad, write=SetOverLoad, default=0};
- __property TParams* Params = {read=FParams, write=SetParamsList};
- __property TParamBindMode ParamBindMode = {read=FBindMode, write=FBindMode, default=0};
- __property UpdateObject ;
- };
-
- class DELPHICLASS TQuery;
- class PASCALIMPLEMENTATION TQuery : public Dbtables::TDBDataSet
- {
- typedef Dbtables::TDBDataSet inherited;
-
- private:
- Bde::_hDBIObj *FStmtHandle;
- Classes::TStrings* FSQL;
- bool FPrepared;
- TParams* FParams;
- System::AnsiString FText;
- Db::TDataLink* FDataLink;
- bool FLocal;
- int FRowsAffected;
- bool FUniDirectional;
- bool FRequestLive;
- char *FSQLBinary;
- bool FConstrained;
- bool FParamCheck;
- bool FCheckRowsAffected;
- Bde::hDBICur __fastcall CreateCursor(bool GenHandle);
- void __fastcall CreateParams(TParams* List, const char * Value);
- virtual void __fastcall DefineProperties(Classes::TFiler* Filer);
- void __fastcall FreeStatement(void);
- Bde::hDBICur __fastcall GetQueryCursor(bool GenHandle);
- void __fastcall GetStatementHandle(char * SQLText);
- int __fastcall GetRowsAffected(void);
- void __fastcall PrepareSQL(char * Value);
- void __fastcall QueryChanged(System::TObject* Sender);
- void __fastcall ReadBinaryData(Classes::TStream* Stream);
- void __fastcall RefreshParams(void);
- void __fastcall SetDataSource(Db::TDataSource* Value);
- void __fastcall SetQuery(Classes::TStrings* Value);
- void __fastcall SetParamsList(TParams* Value);
- void __fastcall SetParams(void);
- void __fastcall SetParamsFromCursor(void);
- void __fastcall SetPrepared(bool Value);
- void __fastcall SetPrepare(bool Value);
- void __fastcall WriteBinaryData(Classes::TStream* Stream);
-
- protected:
- virtual Bde::hDBICur __fastcall CreateHandle(void);
- virtual void __fastcall Disconnect(void);
- virtual Db::TDataSource* __fastcall GetDataSource(void);
- Word __fastcall GetParamsCount(void);
- virtual bool __fastcall SetDBFlag(int Flag, bool Value);
- __property Db::TDataLink* DataLink = {read=FDataLink};
-
- public:
- __fastcall virtual TQuery(Classes::TComponent* AOwner);
- __fastcall virtual ~TQuery(void);
- void __fastcall ExecSQL(void);
- TParam* __fastcall ParamByName(const System::AnsiString Value);
- void __fastcall Prepare(void);
- void __fastcall UnPrepare(void);
- __property bool Prepared = {read=FPrepared, write=SetPrepare, nodefault};
- __property Word ParamCount = {read=GetParamsCount, nodefault};
- __property bool Local = {read=FLocal, nodefault};
- __property Bde::hDBIStmt StmtHandle = {read=FStmtHandle};
- __property System::AnsiString Text = {read=FText};
- __property int RowsAffected = {read=GetRowsAffected, nodefault};
- __property char * SQLBinary = {read=FSQLBinary, write=FSQLBinary};
-
- __published:
- __property bool Constrained = {read=FConstrained, write=FConstrained, default=0};
- __property Constraints = {stored=ConstraintsStored};
- __property Db::TDataSource* DataSource = {read=GetDataSource, write=SetDataSource};
- __property bool ParamCheck = {read=FParamCheck, write=FParamCheck, default=1};
- __property bool RequestLive = {read=FRequestLive, write=FRequestLive, default=0};
- __property Classes::TStrings* SQL = {read=FSQL, write=SetQuery};
- __property TParams* Params = {read=FParams, write=SetParamsList};
- __property bool UniDirectional = {read=FUniDirectional, write=FUniDirectional, default=0};
- __property UpdateMode ;
- __property UpdateObject ;
- };
-
- class DELPHICLASS TUpdateSQL;
- class PASCALIMPLEMENTATION TUpdateSQL : public Dbtables::TDataSetUpdateObject
- {
- typedef Dbtables::TDataSetUpdateObject inherited;
-
- private:
- TBDEDataSet* FDataSet;
- TQuery* FQueries[3];
- Classes::TStrings* FSQLText[3];
- TQuery* __fastcall GetQuery(Db::TUpdateKind UpdateKind);
- Classes::TStrings* __fastcall GetSQL(Db::TUpdateKind UpdateKind);
- Classes::TStrings* __fastcall GetSQLIndex(int Index);
- void __fastcall SetSQL(Db::TUpdateKind UpdateKind, Classes::TStrings* Value);
- void __fastcall SetSQLIndex(int Index, Classes::TStrings* Value);
-
- protected:
- virtual TBDEDataSet* __fastcall GetDataSet(void);
- virtual void __fastcall SetDataSet(TBDEDataSet* ADataSet);
- void __fastcall SQLChanged(System::TObject* Sender);
-
- public:
- __fastcall virtual TUpdateSQL(Classes::TComponent* AOwner);
- __fastcall virtual ~TUpdateSQL(void);
- virtual void __fastcall Apply(Db::TUpdateKind UpdateKind);
- void __fastcall ExecSQL(Db::TUpdateKind UpdateKind);
- void __fastcall SetParams(Db::TUpdateKind UpdateKind);
- __property DataSet ;
- __property TQuery* Query[Db::TUpdateKind UpdateKind] = {read=GetQuery};
- __property Classes::TStrings* SQL[Db::TUpdateKind UpdateKind] = {read=GetSQL, write=SetSQL};
-
- __published:
- __property Classes::TStrings* ModifySQL = {read=GetSQLIndex, write=SetSQLIndex, index=0};
- __property Classes::TStrings* InsertSQL = {read=GetSQLIndex, write=SetSQLIndex, index=1};
- __property Classes::TStrings* DeleteSQL = {read=GetSQLIndex, write=SetSQLIndex, index=2};
- };
-
- class DELPHICLASS TBlobStream;
- class PASCALIMPLEMENTATION TBlobStream : public Classes::TStream
- {
- typedef Classes::TStream inherited;
-
- private:
- Db::TBlobField* FField;
- TBDEDataSet* FDataSet;
- char *FBuffer;
- TBlobStreamMode FMode;
- int FFieldNo;
- bool FOpened;
- bool FModified;
- int FPosition;
- System::AnsiString FBlobData;
- bool FCached;
- int FCacheSize;
- int __fastcall GetBlobSize(void);
-
- public:
- __fastcall TBlobStream(Db::TBlobField* Field, Db::TBlobStreamMode Mode);
- __fastcall virtual ~TBlobStream(void);
- virtual int __fastcall Read(void *Buffer, int Count);
- virtual int __fastcall Write(const void *Buffer, int Count);
- virtual int __fastcall Seek(int Offset, Word Origin);
- void __fastcall Truncate(void);
- };
-
- //-- var, const, procedure ---------------------------------------------------
- #define smTraceBufSize (int)(32774)
- #define dbfOpened (Byte)(0)
- #define dbfPrepared (Byte)(1)
- #define dbfExecSQL (Byte)(2)
- #define dbfTable (Byte)(3)
- #define dbfFieldList (Byte)(4)
- #define dbfIndexList (Byte)(5)
- #define dbfStoredProc (Byte)(6)
- #define dbfExecProc (Byte)(7)
- #define dbfProcDesc (Byte)(8)
- #define dbfDatabase (Byte)(9)
- #define cmVirtual (System::Set<TConfigModes, cfmVirtual, cfmSession> () << cfmVirtual )
- #define cmPersistent (System::Set<TConfigModes, cfmVirtual, cfmSession> () << cfmPersistent )
- #define cmSession (System::Set<TConfigModes, cfmVirtual, cfmSession> () << cfmSession )
- #define cmAll (System::Set<TConfigModes, cfmVirtual, cfmSession> () << cfmVirtual << cfmPersistent << cfmSession \
- )
- extern PACKAGE TSession* Session;
- extern PACKAGE TSessionList* Sessions;
- extern PACKAGE Stdvcl::_di_IProvider __fastcall (*CreateProviderProc)(TDBDataSet* DataSet);
- extern PACKAGE void __fastcall RegisterBDEInitProc(const TBDEInitProc InitProc);
- extern PACKAGE char * __fastcall AnsiToNative(void * Locale, const System::AnsiString AnsiStr, char *
- NativeStr, int MaxLen);
- extern PACKAGE void __fastcall NativeToAnsi(void * Locale, char * NativeStr, System::AnsiString &AnsiStr
- );
- extern PACKAGE void __fastcall AnsiToNativeBuf(void * Locale, char * Source, char * Dest, int Len);
- extern PACKAGE void __fastcall NativeToAnsiBuf(void * Locale, char * Source, char * Dest, int Len);
- extern PACKAGE int __fastcall NativeCompareStr(void * Locale, const System::AnsiString S1, const System::AnsiString
- S2, int Len);
- extern PACKAGE int __fastcall NativeCompareStrBuf(void * Locale, const char * S1, const char * S2, int
- Len);
- extern PACKAGE int __fastcall NativeCompareText(void * Locale, const System::AnsiString S1, const System::AnsiString
- S2, int Len);
- extern PACKAGE int __fastcall NativeCompareTextBuf(void * Locale, const char * S1, const char * S2,
- int Len);
- extern PACKAGE void __fastcall DbiError(Word ErrorCode);
- extern PACKAGE void __fastcall Check(Word Status);
-
- } /* namespace Dbtables */
- #if !defined(NO_IMPLICIT_NAMESPACE_USE)
- using namespace Dbtables;
- #endif
- //-- end unit ----------------------------------------------------------------
- #endif // DBTables
-